package com.guigu.userservice.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 卖家资质表（存储卖家实名认证材料及审核结果）
 * </p>
 *
 * @author zcy
 * @since 2025-09-27
 */
@TableName("seller_qualification")
public class SellerQualification implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 资质申请唯一标识
     */
    @TableId(value = "qualification_id", type = IdType.AUTO)
    private Long qualificationId;

    /**
     * 关联用户表user_id（唯一，一个用户仅一条资质记录）
     */
    private Long userId;

    /**
     * 卖家类型（0-个人卖家，1-企业卖家）
     */
    private Integer sellerType;

    /**
     * 个人卖家身份证正面照片URL（seller_type=0时必填）
     */
    private String idCardFront;

    /**
     * 个人卖家身份证反面照片URL（seller_type=0时必填）
     */
    private String idCardBack;

    /**
     * 企业卖家营业执照照片URL（seller_type=1时必填）
     */
    private String businessLicense;

    /**
     * 企业法人身份证正面照片URL（seller_type=1时必填）
     */
    private String legalIdCardFront;

    /**
     * 企业法人身份证反面照片URL（seller_type=1时必填）
     */
    private String legalIdCardBack;

    /**
     * 审核状态（0-待审核，1-审核通过，2-审核不通过）
     */
    private Integer auditStatus;

    /**
     * 审核备注（审核不通过时填写原因，如"身份证模糊"）
     */
    private String auditRemark;

    /**
     * 审核时间（审核状态变更为1或2时记录）
     */
    private LocalDateTime auditTime;

    /**
     * 申请时间（用户提交资质的时间）
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime applyTime;

    /**
     * 记录创建时间
     */
    private LocalDateTime createTime;

    /**
     * 记录更新时间
     */
    private LocalDateTime updateTime;

    public Long getQualificationId() {
        return qualificationId;
    }

    public void setQualificationId(Long qualificationId) {
        this.qualificationId = qualificationId;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Integer getSellerType() {
        return sellerType;
    }

    public void setSellerType(Integer sellerType) {
        this.sellerType = sellerType;
    }

    public String getIdCardFront() {
        return idCardFront;
    }

    public void setIdCardFront(String idCardFront) {
        this.idCardFront = idCardFront;
    }

    public String getIdCardBack() {
        return idCardBack;
    }

    public void setIdCardBack(String idCardBack) {
        this.idCardBack = idCardBack;
    }

    public String getBusinessLicense() {
        return businessLicense;
    }

    public void setBusinessLicense(String businessLicense) {
        this.businessLicense = businessLicense;
    }

    public String getLegalIdCardFront() {
        return legalIdCardFront;
    }

    public void setLegalIdCardFront(String legalIdCardFront) {
        this.legalIdCardFront = legalIdCardFront;
    }

    public String getLegalIdCardBack() {
        return legalIdCardBack;
    }

    public void setLegalIdCardBack(String legalIdCardBack) {
        this.legalIdCardBack = legalIdCardBack;
    }

    public Integer getAuditStatus() {
        return auditStatus;
    }

    public void setAuditStatus(Integer auditStatus) {
        this.auditStatus = auditStatus;
    }

    public String getAuditRemark() {
        return auditRemark;
    }

    public void setAuditRemark(String auditRemark) {
        this.auditRemark = auditRemark;
    }

    public LocalDateTime getAuditTime() {
        return auditTime;
    }

    public void setAuditTime(LocalDateTime auditTime) {
        this.auditTime = auditTime;
    }

    public LocalDateTime getApplyTime() {
        return applyTime;
    }

    public void setApplyTime(LocalDateTime applyTime) {
        this.applyTime = applyTime;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public LocalDateTime getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public String toString() {
        return "SellerQualification{" +
        "qualificationId = " + qualificationId +
        ", userId = " + userId +
        ", sellerType = " + sellerType +
        ", idCardFront = " + idCardFront +
        ", idCardBack = " + idCardBack +
        ", businessLicense = " + businessLicense +
        ", legalIdCardFront = " + legalIdCardFront +
        ", legalIdCardBack = " + legalIdCardBack +
        ", auditStatus = " + auditStatus +
        ", auditRemark = " + auditRemark +
        ", auditTime = " + auditTime +
        ", applyTime = " + applyTime +
        ", createTime = " + createTime +
        ", updateTime = " + updateTime +
        "}";
    }
}
